﻿@model FinanceChecker.Models.Budget

<div class="text-end">
    <a class="btn btn-primary" asp-area="" asp-controller="Budget" asp-action="AddCategory">Add a New Category</a>
</div>
<div class="container mt-5">
    <div class="row">
        <div class="col-lg-8 mx-auto">
            <div class="card">
                <div class="card-body">
                    <h1 class="mb-4">Create Monthly Budget</h1>
                    @if (TempData["error"] != null)
                    {
                        <div class="alert alert-danger mt-3">@TempData["error"]</div>
                    }
                    <form asp-action="CreateBudget" asp-controller="Budget" method="post">
                        <input type="hidden" asp-for="UserID" />
                        <div class="form-group">
                            <label for="CategoryName">Category Name:</label>
                            <select asp-for="CategoryName" asp-items="(SelectList)ViewBag.Categories" class="form-control">
                                <option value="">-- Select Category --</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="Amount">Amount:</label>
                            <input asp-for="Amount" type="text" class="form-control" />
                            <span asp-validation-for="Amount" class="text-danger"></span>
                        </div>
                        <input type="hidden" asp-for="CategoryID" />
                        <input type="hidden" asp-for="TotalTransactionsAmount" />
                        <input type="hidden" asp-for="CreatedAt" />
                        <input type="hidden" asp-for="UpdatedAt" />
                        <input type="hidden" asp-for="Progress" />
                        <input type="submit" value="Create" class="btn btn-primary" />
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
    .container {
        margin-top: 20px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .btn-primary {
        background-color: #007bff;
        border-color: #007bff;
    }

        .btn-primary:hover {
            background-color: #0056b3;
            border-color: #0056b3;
        }
</style>
